/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package models;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author juju
 */
public class Utilisateur {
    protected int _id;
    protected String _login;
    protected String _password;
    protected int _estAdmin;
    protected int _idClient;    
    private UtilisateurMapper mapper;
    
    public Utilisateur() {
        this.mapper = new UtilisateurMapper();
    }

    public int getId() {
        return _id;
    }

    public void setId(int _id) {
        this._id = _id;
    }

    public String getLogin() {
        return _login;
    }

    public void setLogin(String _login) {
        this._login = _login;
    }

    public String getPassword() {
        return _password;
    }

    public void setPassword(String _password) {
        this._password = _password;
    }

    public int getEstAdmin() {
        return _estAdmin;
    }

    public void setEstAdmin(int _estAdmin) {
        this._estAdmin = _estAdmin;
    }

    public int getIdClient() {
        return _idClient;
    }

    public void setIdClient(int _idClient) {
        this._idClient = _idClient;
    }
    
    public void connexion(String login, String password) {
        this.mapper.connexion(login, password, this);
    }
    
    public void save() {
        this.mapper.save(this);
    }
    
}
